﻿namespace ProxyServer.Entities
{
    public class ServiceEntity(string name, List<string> hosts)
    {
        public Guid Id { get; set; } = Guid.NewGuid();

        public string Name { get; set; } = name;

        public string? MatchPath { get; set; }

        public List<string> Hosts { get; set; } = hosts;
        public List<string>? Methods { get; set; }

        public DateTimeOffset Created { get; set; } = DateTimeOffset.UtcNow;
        public DateTimeOffset LastModified { get; set; } = DateTimeOffset.UtcNow;

        public List<ServiceEndpointEntity> Endpoints { get; set; } = [];

        public Guid AcmeOrderId { get; set; }

        public string? RouteOverwrite { get; set; }
    }

    public class ServiceEndpointEntity(string name, string address)
    {
        public string Name { get; set; } = name;
        public string Address { get; set; } = address;
    }
}
